<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page pageEncoding="UTF-8" %>
<%@ page import="jp.co.technotree.apl.api.common.Message,jp.co.technotree.common.ApplicationManager" %>
<%@ include file="../common/common.jsp"%>
<%@ page import="jp.co.technotree.apl.cmd.master.Mst2000Bean;" %>
<jsp:useBean id="formBean" class="jp.co.technotree.apl.cmd.master.Mst2000Bean" scope="request" />
<%

Mst2000Bean.Record[] recordList = formBean.getRecordList();

%>



<html>
	<head>
		<title>予備品管理システム - 稼働日情報一覧画面</title>
		<link rel="SHORTCUT ICON" href="../common/img/default/sys_icon.ico">

		<link rel='stylesheet' type='text/css' href='../../common/css/common/base.css' >
		<link rel='stylesheet' type='text/css' href='../../common/css/common/common.css'>
		<link rel='stylesheet' type='text/css' href='../../common/css/master/mst2000.css'>
		
		<!--ポップアップ用-->
		<link rel='stylesheet' type='text/css' href='../../common/css/popUpPc.css' >
		<script type='text/javascript' src='../../common/js/popUpPc.js'></script>
		
		<script language="javascript" src="../../common/js/base.js"></script>
		<script language="javascript" src="../../common/js/menu/topmenu.js"></script>

		<!-- システムログ -->
		<script src="../../common/js/systemlog.js"></script>

<style type='text/css'>
.LinkItem {
	cursor: pointer;
}
.div-wid {
	border-bottom:solid 1px #ccc;
	width:550px; /* 横幅合計 + スクロールバー分 */
	height:400px;
	overflow:auto;
}

	.txtmode3 {
		ime-mode: disabled; /* 半角のみモード */
	}
	

	
</style>




<script language="javascript">
function onInit(){


	//既に新規登録されている場合
	var stateFlg = "<%=formBean.getStateFlg()%>";
	
	if(stateFlg == "1"){
		//$1年度の稼働日情報は既に存在しています。
		alert_Custom("<%=Message.getMessage("WRN01140").replace("$1", formBean.getFindYear())%>");
	}else if(stateFlg == "2"){
		//$1年度の稼働日を作成完了しました。
		alert_Info("<%=Message.getMessage("INF00070").replace("$1", formBean.getFindYear())%>");
		
	}
	
	//---------------------------------------------
	
}


function screen_back() {
	location.href="../topmenu/top1000.fw";
}

function updateSerch(yyyymm) {

	mainForm = document.getElementById("F1");
	
	document.getElementById("yymmUpdate").value = yyyymm;

	mainForm.submit();
	
}

//年度検索
function searchBtn(){
	mainForm = document.getElementById("F1");
	
	var findYear = document.getElementById("findYear").value;
	
	
	//空白チェック
	if(findYear==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "年度")%>");
		return;
	}
	
	
	mainForm.submit();
	
}



//新規登録
function insertBtn(){
	mainForm = document.getElementById("F1");
	
	document.getElementById("submitType").value = "1"; //新規登録キー
	
	var findYear = document.getElementById("findYear").value;

	
	//空白チェック
	if(findYear==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "年度")%>");
		return;
	}
	
	
	//WRN02001=2000年以上で入力してください。
	if(findYear.length != 4 || Number(findYear) < 2000){
		alert_Custom("<%=Message.getMessage("WRN02001")%>");
		return;
	}
	
	
	//$1年度の稼働日情報を作成します。よろしいですか？
	if ("undefind"!=confirm_Custom(findYear+"年度の稼働日情報を作成します。よろしいですか？")){
		return;
	}
	
	mainForm.submit();
	
}

//数値のみを入力可能にする
function numOnly() {
  m = String.fromCharCode(event.keyCode);

  if("0123456789\b\r".indexOf(m, 0) < 0) return false;
  return true;
}



//パップアップ解除
function back(){
	document.getElementById("opAlertBtn").style.display = "none";
	document.getElementById("opAlert").style.display = "none";
	document.getElementById("opAlertButton").style.display = "none";
	document.getElementById("opAlertTop").style.display = "none";
	document.getElementById("allbackgr").style.display = "none";
}

//数字しか入力できないように
function numberKeyPress(){
	//備考：少数点とかマイナスを入力させるには48ではなく45かな？
	if ((event.keyCode < 48) || (event.keyCode > 57)){event.returnValue = false;};
}


</script>

</head>

	<body onLoad="onInit()" style="margin: 0px 4px 0px 0px;">
		<form name="main" id="F1" action="./mst2000" method="post" class="frmMain" enctype="multipart/form-data" onsubmit="return false;">
			<table class="tblMain" width="100%" cellspacing="0" cellpadding="0" border="0">

				<tr>
					<td valign="top">
						<table class='main-width-tb'  cellspacing='0' cellpadding='0' border='0'><tr><td></td></tr></table>
						<table class='main-height-tb' cellspacing='0' cellpadding='0' border='0'><tr><td></td></tr></table>

						<!-- Header Menu START -->
						<div class="header-title">予備品管理システム(<%=formBean.kojou%>)</div>
						<!-- Header Menu END -->

						<!-- ***** [FORM] MAIN-FORM ***** -->
						<div id="lc-out" style="z-index: 0;">
							<div id="lc-in" style="z-index: 0">

								<div class="subtitle">稼働日情報一覧画面</div>
								<table  border="0" style="width: 98%;" class="TxtCenter" >
									<tr>
										<td>
											<table border="0" width="600px">
												<tr>
													<td>
														<div class="title">年度</div>
													</td>
													<td>
														<input type="text" id="findYear" name="findYear" class="inputStyle txtmode3"  onKeyPress="numberKeyPress();" style="width:100px;  height:30px; font-size:22px;"  maxlength="4"   onkeyDown=""  value="<%=formBean.getFindYear()%>">
													</td>
													
													<td>
													<input type="image" src="../../common/img/pc/btn_search_off.png" onclick="searchBtn()" alt="検索">
													</td>
													
													<td class="TxtRight">
														
														　　　　
														<input type="image" src="../../common/img/pc/btn_new_insert_off.png" onclick="insertBtn()" alt="新規登録">
														&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
														<input type="image" src="../../common/img/pc/btn_back_off.png" onclick="screen_back()">
													</td>
												</tr>
												<!-- スペース -->
												<tr style="height: 30px;"><td></td></tr>
											</table>
										</td>
									</tr>
								</table>
							</div><!-- lc-in end-->
							<div id="lc-in_under" style="z-index: 0">
								<!-- スペース -->
								<table style="height:20px;"><tr><td></td></tr></table>
								<table  border="0" style="width: 98%;" class="TxtCenter">
									<tr>
										<td>
											<table  border="1" width="520px" height="30px" class="data-grid" >
												<thead>
													<tr>
														<th class="TblField1" style="background-color: #CAE1FF;">&nbsp;</th>
														<th class="TblField2" style="background-color: #CAE1FF;">年</th>
														<th class="TblField3" style="background-color: #CAE1FF;">月</th>
														<th class="TblField4" style="background-color: #CAE1FF;">稼働日</th>
														<th class="TblField5" style="background-color: #CAE1FF;">非稼働日</th>
														<th class="TblField6" style="background-color: #CAE1FF;">&nbsp;</th>
													</tr>
												</thead>
											</table>
											<div class="div-wid" id="div-wid">
											<table  border="1" width="530px" height="30px" class="data-grid" >
<%
int recordCount = 0;
if (recordList != null) {
	for(int i=0; i< recordList.length; i++){
%>


												<tr style="background-color: <%=("true".equals(recordList[i].colorFlg))?"#FFFFFF":"" %>">
													<td class="TblField1"  align="center">
														<%=i+1 %>
													</td>
													<td class="TblField2" align="center"><%=recordList[i].workingY %></td>
													<td class="TblField3" align="center"><%=recordList[i].workingM %></td>
													<td class="TxtRight TblField4"><%=recordList[i].div0 %></td>
													<td class="TxtRight TblField5"><%=recordList[i].div1 %></td>
													<td class="TxtCenter TblField6"><input type="button" value="変更" onclick="updateSerch('<%=recordList[i].workingY  + recordList[i].workingM %>')" ></td>
												</tr>
<%
	}
}
%>
											</table>
											</div>

										</td>
									</tr>
								</table>
							</div><!-- lc-in_under End -->

							<!-- ログ Start -->
							<!-- ログ End -->

						</div><!-- lc-out  -->
					</td>
				</tr>
			</table>


			<!--警告 ポップアップ---------------------------------------------------------------------------- -->
			<div id="allbackgr" class="allbackgr" style="display:none;"></div>
			<div class="opAlertBtn" id = "opAlertBtn" style="display:none;" ></div>
			<div class="opAlertButton" id = "opAlertButton" style="display:none;" ></div>
			<div class="opAlertTop" id = "opAlertTop" style="display:none; font-size:22px;">　予備品管理システム　</div>
			<div class="opAlert" id = "opAlert" style="display:none;"></div>
			<!-- -------------------------------------------------------------------------------------------- -->


			<input type="hidden" name="cmd" value="cmd01">
			<input type="hidden" name="submitType" id="submitType" value="">
			<input type="hidden" name="uplodFile" id="uplodFile" value="">
			<input type="hidden" name="deleteSheet" id="deleteSheet" value="">
			<input type="hidden" name="deleteSheetName" id="deleteSheetName" value="">
			
			<input type="hidden" name="yymmUpdate" id="yymmUpdate" value="">
		</form>
	</body>
</html>